Xbasic

TEXT.SET_CURSOR Function

Syntax

VariableName.OBJECT.SET_CURSOR( Offset as N )

Description

The OBJECT.SET_CURSOR() method is used with an Xdialog text control. It sets the location of the cursor the in the VariableName text variable and sets focus to the text control.

Example

dim ptext as P
dim ptext.text as C
dim ptext.object as P
dim ip as N
dim new_ip as N
if a_dlg_button = "paste" then
    a_dlg_button = ""
    'get the current insertion point
    ip = ptext.object.get_cursor()
    new_ip = ip + len(ClipBoard.Get_Data())
    ptext.object.paste()
    'after clicking the 'paste' button focus is on the button. we want to return focus to the edit control
    ui_dlg_ctl_goto(dlg_title,"ptext")
    ptext.object.set_cursor(new_ip)
    'this causes the text box to scroll if the insertion point is not currently visible
    ptext.object.show_caret()
end if

Limitations

Desktop applications only.

See Also